/*
 * TCPMessenger.h
 *
 *  Created on: 28.03.2011
 *      Author: niea
 */

#pragma once

#include "TCPMessengerI.hpp"
#include "../common/ClientEntry.hpp"
#include "../common/ClientEntryList.hpp"
#include "../common/log.hpp"
#include <string>
#include <vector>

namespace efs
{

class TCPMessenger : public TCPMessengerI
{
public:
	TCPMessenger(ClientEntryList *client_list);
	virtual ~TCPMessenger();
	void sendMessages(std::string const &msg);

private:
	ClientEntryList *m_client_list;

	int sendMessage(ClientEntry & client, std::string const &msg);
	int sendAll(int sock, std::string const &msg);
};

}

